Release 10.1A: OpenEdge Data Management:
SQL Development


How the query optimizer works

The optimizer works not only on statements reading data, but also on statements writing data. For any SQL statement, there are many possible methods to compute results. The optimizer decides which methods to use, the order in which to apply the methods, and the characteristics of each method. The optimization model used by the OpenEdge SQL Engine is a synthesis of:

Representing the statement as a query tree

The query processor makes extensive use of a relational algebra tree representation to model and manipulate SQL queries. At various points within the tree, operations are performed on the data. Each operation is represented as a node in the tree. Nodes can have one or more expressions associated with them to specify columns, conditions, and calculations associated with the operation.

Some of the operators that might be present in the tree are:

Leaf nodes of the tree are always references to database tables. The following diagram illustrates a tree produced for the query:

SELECT Name, OrderDate

FROM Customer, Order

WHERE Order."OrderDate" = Order."ShipDate";

This query lists the names and order dates for all customers whose orders were shipped on the same day the order was placed:


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095